package com.attendance.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.common.util.Examine;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.staff.entity.Staff;

@Entity
@Table(name="t_apply_leave")
public class ApplyLeave {//请假申请表
	private Long id;
	private Staff staff; //申请人
	private String reason;//原因
	private Date startTime;
	private Date endTime;
	private Staff auditor;//审核人
	private Examine status;//审核状态:待审核，已通过
	private String examineReason;//审核意见
	private Date launchTime;//发起时间
	private Date examineTime;//审核时间
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	@JsonIgnore
	@ManyToOne(cascade=CascadeType.ALL)
	public Staff getStaff() {
		return staff;
	}
	public String getReason() {
		return reason;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getStartTime() {
		return startTime;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getEndTime() {
		return endTime;
	}
	@JsonIgnore
	@ManyToOne(cascade=CascadeType.ALL)
	public Staff getAuditor() {
		return auditor;
	}
	public Examine getStatus() {
		return status;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getLaunchTime() {
		return launchTime;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getExamineTime() {
		return examineTime;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setStaff(Staff staff) {
		this.staff = staff;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public void setAuditor(Staff auditor) {
		this.auditor = auditor;
	}
	public void setStatus(Examine status) {
		this.status = status;
	}
	public void setLaunchTime(Date launchTime) {
		this.launchTime = launchTime;
	}
	public void setExamineTime(Date examineTime) {
		this.examineTime = examineTime;
	}
	public String getExamineReason() {
		return examineReason;
	}
	public void setExamineReason(String examineReason) {
		this.examineReason = examineReason;
	}
	
}
